extends Node2D

@export var PlayerScene: PackedScene

func _ready():
	var index = 0
	for i in Game.players:
		var player = PlayerScene.instantiate()
		player.name = str(Game.players[i].id)
		add_child(player)
		# 设置玩家的初始位置
		for location in get_tree().get_nodes_in_group("PlayerPoint"):
			if location.name == str(index): player.global_position = location.global_position
		index += 1
